#ifndef MDICHILD_H
#define MDICHILD_H

#include <QWidget>
#include <QGroupBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QRegExpValidator>
#include <QRegExp>
#include <QTableWidget>
#include <QHeaderView>
#include <QTcpServer>
#include <QHostAddress>
#include <QMap>
#include <QList>
#include <QTimer>
#include <QTcpSocket>
#include <QMessageBox>
#include <QTextEdit>

class MdiChild : public QWidget
{
    Q_OBJECT

public:
    MdiChild(QWidget *parent = 0);
    ~MdiChild();
    virtual void ChildWidget(QVBoxLayout *playout) = 0;
    virtual void SendData() = 0;
    void SendData0(char* buf, int len);
    virtual void RecvData(char* buf, int len);
    void clientWidget(QVBoxLayout *playout);
private:
    QTimer *m_timer;
    QPushButton *pConn;
    QPushButton *pStop;
    QLineEdit *localhostLineEdit;
    QLineEdit *localportLineEdit;
    QTcpSocket *m_tcpclient;
public slots:
    void onTimeSendData();
    void readFortune();
    void displayError(QAbstractSocket::SocketError socketError);
    void requestNewFortune();
    void closeclient();
};

#endif // MDICHILD_H
